package com.example.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.pojo.Examine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vo.ExamineVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyj
 * @since 2023-02-15
 */
public interface ExamineMapper extends BaseMapper<Examine> {

    @Select("select so.name officeName,\n" +
            "su.name username,\n" +
            "e.* \n" +
            "from examine e\n" +
            "left join sys_user su\n" +
            "on e.examine_user_id=su.id\n" +
            "left join sys_office so \n" +
            "on su.office_id=so.id ${ew.customSqlSegment}")
    IPage<ExamineVo> findAllExamineVo(IPage<ExamineVo> page, @Param("ew") QueryWrapper<ExamineVo> wrapper);
}
